<template>
	<view>
		<treeNode v-for="item in tree" :selectIds="selectIds" :selectGroup="selectGroup" :isState="isState" :item="item"
			:key="item.id" :defaultProps="defaultProps"></treeNode>
	</view>
</template>
<script>
import treeNode from './tree-node.vue';
export default {
	components: {
		treeNode,
	},
	props: {
		isState: {// 区分保养跟考勤页面样式显示
			type: [Number,String],
			default: 1
		},
		selectIds: {
			type: [String,Number],
			default: ''
		},
		selectGroup: {
			type: String,
			default: ''
		},
		tree: {
			type: Array,
			default: () => {
				return [];
			}
		},
		defaultProps: {
			type: Object,
			default: () => {
				return {
					id: 'id',
					children: 'children',
					label: 'title'
				};
			}
		},
		showState: {
			type: Boolean,
			default: true
		}
	},
	provide() {
		return {
			defaultProps: this.defaultProps,
			onClickItem: this.onClickItem
		};
	},
	data() {
		return {

		};
	},
	watch: {
		tree(val) { 
		}
	},
	mounted() {
		console.log(11);
	},
	methods: {
		onClickItem(e) {
			// console.log(e);
			this.$emit('node-click', e);
		}
	}
};
</script>
<style scoped>

</style>
